package com.hp.siminterface.webservice.impl;

import java.util.List;

import com.hp.siminterface.domain.Process;
import com.hp.siminterface.persistence.ProcessMapper;
import com.hp.siminterface.webservice.ProcessService;

/**
 * query process status services implements
 * 
 * @author zhenshis
 * 
 */
public class ProcessServiceImpl implements ProcessService {

	/**
	 * CIMProcessorMapper
	 */
	private ProcessMapper processMapper;

	@Override
	public Process[] getProcessInfo(String hostname) {
		List<Process> processes = processMapper.selectProcessInfo();
		Process[] processArray = new Process[processes.size()];
		int i = 0;
		for (Process process : processes) {
			processArray[i] = process;
			i++;
		}
		return processArray;
	}

	public ProcessMapper getProcessMapper() {
		return processMapper;
	}

	public void setProcessMapper(ProcessMapper processMapper) {
		this.processMapper = processMapper;
	}

}
